package cn.itcast.day03.匿名内部类;

public class Test {
    public static void main(String[] args) {
        new Animal(){
            @Override
            public void eat() {
                System.out.println("人要吃饭");
            }
        }.eat();

        System.out.println("---------------");

        Animal animal = new Animal() {
            @Override
            public void eat() {
                System.out.println("人吃狗");
            }
        };
        animal.eat();
    }
}
